/*
 * @Description: 机票订单查询
 * @Version: 2.0
 * @Autor: 许国辉
 * @Date: 2022-12-02 09:47:15
 * @LastEditors: 许国辉
 * @LastEditTime: 2023-07-19 13:15:36
 */
import { defHttp } from '/@/utils/http/axios';
import { getNewDate } from '/@/api/travelItinerary/getDateAPI';
import { OrderStatisticsAirModel, OrderStatisticsAirParams } from './OrderStatisticsAirModel';
enum Api {
  getOrderStatisticsAir = '/statistics/getOrderStatisticsAir',
}
export function getOrderStatisticsAir(params: OrderStatisticsAirParams) {
  return defHttp.post<OrderStatisticsAirModel>({
    url: Api.getOrderStatisticsAir,
    params,
    headers: {
      ignoreCancelToken: true,
    },
  });
}
export function getOrderStatisticsAirBybookingWay1(params: OrderStatisticsAirParams) {
  params.bookingWay = 1;
  if (params.optDateStart === undefined) {
    params.optDateStart = getNewDate('before', 1);
  }
  return defHttp.post<OrderStatisticsAirModel>({
    url: Api.getOrderStatisticsAir,
    params,
    headers: {
      ignoreCancelToken: true,
    },
  });
}
export function getOrderStatisticsAirBybookingWay2(params: OrderStatisticsAirParams) {
  params.bookingWay = 2;
  if (params.optDateStart === undefined) {
    params.optDateStart = getNewDate('before', 1);
  }
  return defHttp.post<OrderStatisticsAirModel>({
    url: Api.getOrderStatisticsAir,
    params,
    headers: {
      ignoreCancelToken: true,
    },
  });
}
